import java.io.IOException;
import java.net.SocketException;
import java.util.HashMap;

//翻译服务器
public class UdpDictServer extends UdpEchoClient{
    HashMap<String,String> map = new HashMap<>();


    public UdpDictServer(int port) throws SocketException {
        super(port);

        map.put("Cat","小猫");
        map.put("Dog","小狗");
        map.put("fuck","卧槽");
    }

    @Override
    public String Process(String str1) {
        return map.getOrDefault(str1,"找不到!");
    }

    public static void main(String[] args) throws IOException {
        UdpDictServer udp = new UdpDictServer(2000);
        udp.stack();
    }
}
